package com.zhitxx.common.utils

import android.util.Log
import com.zhitxx.common.BuildConfig
import org.json.JSONObject

/**
 * 日志打印工具类
 */
class LogUtils {

    companion object {
        private var isDebug = BuildConfig.BUILD_TYPE == "debug"
        val TAG = AppUtils.getPackageName()
        fun d(message: String) {
            if (isDebug) {
                Log.d(TAG, message)
            }
        }

        fun d(TAG: String, message: String) {
            if (isDebug) {
                Log.d(TAG, message)
            }
        }

        fun i(message: String) {
            if (isDebug) {
                Log.i(TAG, message)
            }
        }

        fun i(TAG: String, message: String) {
            if (isDebug) {
                Log.i(TAG, message)
            }
        }

        fun v(message: String) {
            if (isDebug) {
                Log.w(TAG, message)
            }
        }

        fun v(TAG: String, message: String) {
            if (isDebug) {
                Log.w(TAG, message)
            }
        }

        fun e(message: String) {
            if (isDebug) {
                Log.e(TAG, message)
            }
        }

        fun e(TAG: String, message: String) {
            if (isDebug) {
                Log.e(TAG, message)
            }
        }
    }
}